package com.xuan.webfinally.service.impl;


import com.xuan.webfinally.mapper.HomePageMapper;
import com.xuan.webfinally.mapper.SlopeWarningInfoMapper;
import com.xuan.webfinally.service.IHomePageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class HomePageServiceImpl implements IHomePageService {

    @Autowired
    private HomePageMapper homePageMapper;



    @Autowired
    private SlopeWarningInfoMapper slopeWarningInfoMapper;


    /**
     * 获取监测项目数量
     * @return
     */
    @Override
    public int getvalueofjcxm() {
        return homePageMapper.getSumOfJcxm();
    }

    @Override
    public int getSumOfYjcs() {
        return homePageMapper.getyujingcs();
    }

    @Override
    public int getSumOfXzyh() {
        return homePageMapper.getxzyh();
    }

    @Override
    public int countRedWarning() {
        return slopeWarningInfoMapper.countRedWarning();
    }

    @Override
    public int countYellowWarning() {
        int  yellowWarningCount = slopeWarningInfoMapper.countYellowWarning();
        System.out.println("-------------------------------------");
        return yellowWarningCount;
    }

    @Override
    public int countBlueWarning() {
        return slopeWarningInfoMapper.countBlueWarning();
    }

    @Override
    public int countOrangeWarning() {
        return slopeWarningInfoMapper.countOrangeWarning();
    }
}
